function Model(){
	this.customer = new Customer();
	this.project = new Project();
	this.resources = new Array();
	
	this.addResource = function(resource){
		if(resource != null){
			this.resources.push(resource);
		}
	}
	
	this.toString = function(){
		return 'Model [customer='+this.customer.toString()+', project='+this.project.toString()+', resources='+this.resources.toString()+']';
	}
}

function Account(){
	this.email;
	this.password;
	this.active;
	
	this.toString = function(){
		return 'Account [email='+email+', password='+password+', active='+active+']';
	}
}

function Address(){
	this.id;
	this.street;
	this.number;
	this.postalCode;
	this.city;
	this.country;
	
	this.toString = function(){
		return 'Address [id='+this.id+', street='+this.street+', number='+this.number+
			', postalCode='+this.postalCode+', city='+this.city+', country='+this.country+']';
	}
}

function Customer(){
	this.id;
	this.customerName;
	this.customerNumber;
	this.vat;
	this.contactPerson;
	this.paymentTerms;
	this.address = new Address();
	
	this.toString = function(){
		return 'Customer [id='+this.id+', customerName='+this.customerName+
				', customerNumber='+this.customerNumber+', vat='+this.vat+
				', contactPerson='+this.contactPerson+', paymentTerms='+
				this.paymentTerms+', address='+this.address.toString()+']';
	}
}

function Project(){
	this.id;
	this.name;
	this.code;
	this.unit;
	this.startDate;
	this.endDate;
	this.projectType;
	this.transversalLine;
	this.deliveryPractice;
	this.accountManager;
	this.engagamentManager;
	this.deliveryManager;
	this.fixedPriceAmount;
	this.volumeDiscount;
	this.invoiceReference;
	this.appendix;
	this.po;
	
	this.toString = function(){
		return 'Project [id='+this.id+', name='+this.name+', code='+this.code+', unit='+this.unit+
				', startDate='+this.startDate+', endDate='+this.endDate+', projectType='+this.projectType+
				', transversalLine='+this.transversalLine+', deliveryPractice='+this.deliveryPractice+', accountManager='+this.accountManager+
				', engagamentManager='+this.engagamentManager+', deliveryManager='+this.deliveryManager+', fixedPriceAmount='+this.fixedPriceAmount+
				', volumeDiscount='+this.volumeDiscount+', invoiceReference='+this.invoiceReference+', appendix='+this.appendix+
				', po='+this.po+']';
	}
}

function Resource(){
	this.id;
	this.taskName;
	this.endDate;
	this.startDate;
	this.percentage;
	this.level;
	this.dailyRate;
	this.employee = new Employee();
	
	this.toString = function(){
		return 'Resource [id='+this.id+', taskName='+this.taskName+
				', endDate='+this.endDate+', startDate='+this.startDate+
				', percentage='+this.percentage+', level='+this.level+', dailyRate='+this.dailyRate+', employee='+this.employee.toString()+']';
	}
}

function Subcontractor(){
	this.email;
	this.dailyPurchasePrice;
	this.companyName;
	
	this.toString = function(){
		return 'Subcontractor [id='+this.id+', taskName='+this.taskName+
				', endDate='+this.endDate+', startDate='+this.startDate+
				', percentage='+this.percentage+', level='+this.level+', dailyRate='+this.dailyRate+
				', email='+this.email+', dailyPurchasePrice='+this.dailyPurchasePrice+', companyName='+this.companyName+', employee='+this.employee.toString()+']';
	}
}
//mapping inheritance
Subcontractor.prototype = new Resource();

function Employee(){
	this.id;
	this.firstName;
	this.lastName;
	this.type;
	this.unit;
	this.employeeNumber;
	
	this.toString = function(){
		return 'Employee [id='+this.id+', firstName='+this.firstName+
				', lastName='+this.lastName+', type='+this.type+
				', unit='+this.unit+', employeeNumber='+this.employeeNumber+']';
	}
}